package www.geek.filemanager.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;

import www.geek.filemanager.R;


/**
 * description	:
 *
 * @author : zhanggeng
 * @version : v1.0
 *          ----------修订历史-----------
 * @date : 15/7/30
 */
public class TextManagerAdapter extends BaseAdapter {

    private Context mContext;

    public TextManagerAdapter(Context context) {
        mContext = context;
    }

    @Override
    public int getCount() {
        return 40;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        ViewHolder holder = null;


        if (convertView == null) {
            convertView = LayoutInflater.from(mContext).inflate(R.layout.item_text, null);

            holder = new ViewHolder();

            holder.imageView = (ImageView) convertView.findViewById(R.id.img_text_category);
            holder.tv_text_name = (TextView) convertView.findViewById(R.id.tv_text_name);
            holder.tv_text_singer = (TextView) convertView.findViewById(R.id.tv_text_writer);
            holder.tv_text_album = (TextView) convertView.findViewById(R.id.tv_text_size);
            holder.cb_checked = (CheckBox) convertView.findViewById(R.id.cb_text);

            convertView.setTag(holder);
        } else {
            convertView.getTag();
        }

//        holder.imageView.setImageDrawable(mContext.getResources().getDrawable(R.drawable.ic_launcher));
//        holder.tv_name.setText("name");
//        holder.tv_version.setText("v5.0.0");
//        holder.tv_start.setText("start");
//
//        holder.tv_run.setText("run");
//        holder.cb_checked.setChecked(true);

        return convertView;
    }

    public class ViewHolder {

        public ImageView imageView;

        public TextView tv_text_name;
        public TextView tv_text_singer;
        public TextView tv_text_album;

        public CheckBox cb_checked;
    }

}
